<?php 
	$objConver  			= new HT_Model_administrator_models_convert();
	$objUtil  				= new HT_Model_administrator_models_utility();
	$homeNews 				= $this->homeNews;
	$seoNews 				= $homeNews['seoNews'];
	$trainingNews 			= $homeNews['trainingNews'];
	$keywordList			= $homeNews['keywordList'];
?>
<div class="column1 fl">
	<div class="c1_box1_1">
		<div class="hot_news fl">
			<div class="seo_image"><img title="" alt="" src="<?php echo WEB_PATH;?>/public/images/dich-vu-seo-tu-khoa-chuyen-nghiep.jpg" /></div>
			<form id="frmRequest" name="frmRequest" method="post">
			<input type="hidden" id="requestUrl" value="<?php echo WEB_PATH;?>/front/elements/seorequest/">
			<div class="seo_service">
				<div class="seosv_line"><span>Website của bạn</span></div>
				<div class="seosv_line"><input type="text" id="website" name="website" /> </div>
				<div class="cb"></div>
				<div class="seosv_box1 fl">
					<div class="seosv_line"><span>Từ khóa muốn SEO</span></div>
					<div class="seosv_line1"><textarea id="keywords" name="keywords"></textarea></div>
				</div>
				<div class="seosv_box2 fl">
					<div class="seosv_line"><span>Thông tin liên hệ</span></div>
					<div class="seosv_line1"><textarea id="contact" name="contact"></textarea></div>
				</div>
				<div class="cb"></div>
				<div id="requestBtn" class="seosv_button fr">Đăng ký SEO ngay</div>
				<div id="loading" class="loading mt15 mr5 fr"></div>
				<div class="cb"></div>
				</form>
			</div>
		</div>
		<div class="hot_news_list fl">
			<div class="hot_news_list_header">Dịch vụ SEO từ khóa chuyên nghiệp</div>
			<?php 
				for($i=0;$i<4;$i++){
					$news 				= @$seoNews[$i];
					$newsTitle 			= stripcslashes($news['title']);
					$newsPath 			= ROOT_PATH."/public/uploads/news/".$news['image'];
					$newsImageUrl		= null;
					if(is_file($newsPath)){
						$newsImageUrl	= WEB_PATH."/public/uploads/news/".$news['image'];
					}
					$newsDescription 	= $objUtil->tooltipString(trim(stripcslashes($news['description'])),100);
					$newsUrl			= WEB_PATH.'/chi-tiet/'.$objConver->utf8_to_url($newsTitle).'-'.$news['news_id'].'.html';
			?>
			<div class="hot_item">
				<?php if($newsImageUrl){?>
				<div class="hot_item_image fl"><img src="<?php echo $newsImageUrl;?>"></div>
				<?php }?>
				<a alt="<?php echo $newsTitle;?>" title="<?php echo $newsTitle;?>" href="<?php echo $newsUrl;?>"><?php echo $newsTitle;?></a>
				<br>
				<?php echo $newsDescription;?>
			</div>
			<div class="cb"></div>
			<?php }?>
		</div>
		<div class="cb"></div>
	</div>
	<!-- div class="c1_box2">
		<?php 
			for($i=4;$i<8;$i++){
				$news 				= @$seoNews[$i];
				$newsTitle 			= stripcslashes($news['title']);
				$newsPath 			= ROOT_PATH."/public/uploads/news/".$news['image'];
				$newsImageUrl		= null;
				if(is_file($newsPath)){
					$newsImageUrl	= WEB_PATH."/public/uploads/news/".$news['image'];
				}
				$newsDescription 	= $objUtil->tooltipString(trim(stripcslashes($news['description'])),100);
				$newsUrl			= WEB_PATH.'/chi-tiet/'.$objConver->utf8_to_url($newsTitle).'-'.$news['news_id'].'.html';
		?>
		<div class="cb2_item fl">
			<?php if($newsImageUrl){?>
			<div class="cb2_image"><img src="<?php echo $newsImageUrl;?>"></div>
			<?php }?>
			<div class="cb2_title"><a alt="<?php echo $newsTitle;?>" title="<?php echo $newsTitle;?>" href="<?php echo $newsUrl;?>"><?php echo $newsTitle;?></a></div>
		</div>
		<?php }?>
		<div class="cb"></div>
	</div -->
	<div class="c1_box3">
		<div class="yb_header">
			<div class="ybh_1 fl"></div>
			<div class="ybh_subject fl"><a href="#">Từ khóa mới</a></div>
			<div class="ybh_3 fl"></div>
			<div class="ybh_item fl">Những từ khóa mới nhất đang được SEO bởi goodgood.vn</div>
			<div class="cb"></div>
		</div>
		<?php 
			foreach((array)$keywordList as $news){
				$tagTitle 			= stripcslashes($news['tag_title']);
				$newsPath 			= ROOT_PATH."/public/uploads/news/".$news['image'];
				$newsImageUrl		= null;
				if(is_file($newsPath)){
					$newsImageUrl	= WEB_PATH."/public/uploads/news/".$news['image'];
				}
				$newsUrl			= WEB_PATH.'/nen-doc/'.$objConver->utf8_to_url($tagTitle).'-'.$news['seopage_id'].'.html';
		?>
		<div class="sv_item fl">
			<div class="svi_name"><a href="<?php echo $newsUrl;?>" title="<?php echo $tagTitle;?>" alt="<?php echo $tagTitle;?>"><?php echo $tagTitle;?></a></div>
			<?php if($newsImageUrl){?>
			<div class="svi_image"><img title="<?php echo $tagTitle;?>" alt="<?php echo $tagTitle;?>" src="<?php echo $newsImageUrl;?>" /></div>
			<?php } ?>
		</div>
		<?php } ?>
		<div class="cb"></div>
		<!-- div class="see_all mt10"><a href="<?php echo $groupLink;?>">Xem tất cả</a></div -->
	</div>
	<div class="cb"></div>
</div>
<div class="column2 fl">
	<?php echo $this->action('rightadv1','elements','front');?>
	<div class="top_news_list">
		<div class="hot_news_list_header">Thông tin đào tạo</div>
		<?php 
			foreach((array)$trainingNews as $news){
				$newsTitle 			= stripcslashes($news['title']);
				$newsPath 			= ROOT_PATH."/public/uploads/news/".$news['image'];
				$newsImageUrl		= null;
				if(is_file($newsPath)){
					$newsImageUrl	= WEB_PATH."/public/uploads/news/".$news['image'];
				}
				$newsDescription 	= $objUtil->tooltipString(trim(stripcslashes($news['description'])),70);
				$newsUrl			= WEB_PATH.'/chi-tiet/'.$objConver->utf8_to_url($newsTitle).'-'.$news['news_id'].'.html';
		?>
		<div class="top_item_info">
			<?php if($newsImageUrl) echo '<div class="top_item_image fl"><img alt="" src="'.$newsImageUrl.'"></div>'; ?>
			<a alt="<?php echo $newsTitle;?>" title="<?php echo $newsTitle;?>" href="<?php echo $newsUrl;?>"><?php echo $newsTitle;?></a>
			<p><?php echo $newsDescription;?></p>
			<div class="cb"></div>
		</div>
		<div class="cb"></div>
		<?php } ?>
	</div>
	<?php //echo $this->action('rightadv2','elements','front');?>
</div>
<div class="cb"></div>


<script type="text/javascript">
	$(document).ready(function(){
		$('#requestBtn').click(function(){
			if($('#keywords').val() == ''){
				alert("Vui lòng nhập danh sách từ khóa mà bạn muốn SEO");
				$('#keywords').focus();
				return;
			}
			if($('#contact').val() == ''){
				alert("Vui lòng nhập thông tin liên hệ của bạn");
				$('#contact').focus();
				return;
			}else{
				$('#loading').show();
				$.ajax({
			        url: $("#requestUrl").val(),
			        cache: false,
			        type: "POST",
			        data: $('#frmRequest').serialize(),           
			        success: function(serverData){
			        	$('#loading').hide();
			        	alert("Cảm ơn bạn đã gửi yêu cầu SEO từ khóa. Chúng tôi sẽ liên hệ với bạn trong thời gian sớm nhất!");
			        	$('#website').val('');
			        	$('#keywords').val('');
			        	$('#contact').val('');
			        }
			      });
			}
		});
	});
</script>